
options ls=84 nocenter;
libname save '/bbkinghome/sschaner/Angrist Work/Web Papers/Angrist_2002/immig/1900/sasdata/';

/* table2.sas: for Helen 6-17-00, ethnicity and sex ratio
	8-24-00 includes younger cohort only
	from FIRSTWOM2: female first stage and RFs: uses data11b
	revides 6-14-00 to use corrected income score imputation from
	firstwom1.
	6-4-00 RETYPED
	8/7/07 -- TRANSCRIBED FROM PRINTOUT BY SIMONE SCHANER
*/

data two;
	set save.data11b;
	if (91 le year le 94) and (2 le nativity le 5);
	if 18 le age le 35;
	if nativity=1 then column='native';
		else if 2 le nativity le 4 then column='2ndgen';
		else if nativity=5 then column='fb';
		
	cohort=(1*(year=91))+(2*(year=92))+(3*(year=94));
	if cohort ne .;
	
proc sort data=two; by column year code; run;
proc freq data=two;
	title 'table 2: ethnicity distribution of foreign-stock';
	weight slwt;
	table code*year; 
	by column;
	
proc summary data=two;
	weight slwt;
	by column year code;
	var female;
	output out=fb1 mean=pctfem sumwgt=nimmig;
	
data fb1;
	set fb1;
	women=pctfem*nimmig;
	men=(1-pctfem)*nimmig;
	ratio=men/women;
	lnimmig=log(nimmig);
	label ratio='men/women among fb';
	run;
	
proc print data=fb1;
	title 'table 2: sex ratios among foreign stock';
	var column year code ratio;
	run;